<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
    <h:head>
        <title>Facelet Title</title>
        
    </h:head>
    <h:body>
        <ui:composition template="../../admin/adminTemplate.xhtml">
            
            <ui:define name="title">
                Admin Schema
            </ui:define>
            <ui:define name="page">
                
       <h1>Visa middagsrätter</h1>
        <p> Obs! Rätter som är beställda kan inte tas bort!</p>
       
       <h:dataTable class ="form" value="#{listDinner.dinnerIngredients}" var="c"
                    
                            styleClass="order-table"
                            headerClass="order-table-header"
                            rowClasses="order-table-odd-row,order-table-even-row"
    		>
 
    		<h:column >
    			<f:facet name="header">
    				Namn på rätt
    			</f:facet>
    				#{c.dinnerName}
    		</h:column>
 
    		<h:column>
    			<f:facet name="header">
    				Beskrivning
				</f:facet>
    				#{c.dinnerDescription}
    		</h:column>
 
 			<h:column>
    			<f:facet name="header">
    				Pris
				</f:facet>
    				#{c.dinnerPrice}
    		</h:column>
 
    		<h:column>
    			<f:facet name="header">
    				 Typ av rätt
				</f:facet>
    				#{c.dinnerType}
    		</h:column>
           
           <h:column>
    			<f:facet name="header">
    				Åtgärd
				</f:facet>
               <h:form>
               <h:commandButton value="Ta Bort" action="#{listDinner.destroy(c.dinnerName)}" />
               
               <h:commandButton value="Redigera" action="#{listDinner.prepareUpdate(c.dinnerName, c.dinnerDescription, c.dinnerPrice, c.dinnerType)}"/>
               
               <h:commandButton value="Visa rätt" action="#{listDinner.niceView(c.dinnerName)}" />
               
               </h:form>
           </h:column>
           
          
 
    	</h:dataTable> 
        
             
        </ui:define>
        
        </ui:composition>
        
        
        
        
        
        
        
        
        
        
        
    </h:body>
</html>

